<template>
  <view class="profile-container">
    <s-nav-bar isBack isWhite />
    <CoverSwiper :list="coverList" />
    <ContentCard :info="userInfo"/>
  </view>
</template>
<script>
import CoverSwiper from './components/cover-swiper.vue';
import ContentCard from './components/content-card.vue';
import { UserInfo } from '@/api/index.js';
export default {
  name: 'Profile',
  components: {  CoverSwiper, ContentCard },
  props: {},
  data() {
    return {
      userInfo:{},
      coverList: [
        'https://picx.zhimg.com/v2-f7f80f8e043765df0caf0135f15f0bfa_1440w.jpg',
        'https://picx.zhimg.com/v2-f7f80f8e043765df0caf0135f15f0bfa_1440w.jpg',
        'https://picx.zhimg.com/v2-f7f80f8e043765df0caf0135f15f0bfa_1440w.jpg',
        'https://picx.zhimg.com/v2-f7f80f8e043765df0caf0135f15f0bfa_1440w.jpg',
      ],
    };
  },
  created() {
    const { userId } = uni.getStorageSync('userInfo');
    this.onGetUserInfo({ userId });
  },
  onShow() {},
  mounted() {},
  methods: {
    async onGetUserInfo({userId}) {
      const { code, data } = await UserInfo({ userId });
      if (code === 200) {
        this.userInfo= data
      }
    },
  },
};
</script>
<style>
page {
  background: #f8f8ff;
}
</style>
<style lang="scss" scoped></style>
